package com.fastjrun.eladmin.itrms.domain;

import com.fastjrun.eladmin.itrms.common.exception.DomainException;

public enum SERVER_TYPE {
    HOST(1,"主机"),
    K8S_NODE(2,"k8s集群节点");

    SERVER_TYPE(int key,String value){
        this.key =key;
        this.value =value;
    }
    private int key;
    private String value;

    public static String getValue(int key){
        for(SERVER_TYPE server_type:SERVER_TYPE.values()){
            if(server_type.key==key){
                return server_type.value;
            }
        }
        throw new DomainException(String.format("the enum SERVER_TYPE for key:%d not provided.",key));
    }


}
